-
Notifications
You must be signed in to change notification settings - Fork 183
Replace nativeZoom of widgets with disabled autoscaling with 100 #2599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
80868a9
to
ecbd0c0
Compare
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java
Outdated
Show resolved
Hide resolved
10fe424
to
29ded18
Compare
The nativeZoom of some widgets currently always has the original native zoom value, even if autoscaling is disabled for that widget such that they behave as if their native zoom is effectively 100. With this change the behavior of those widgets will be fixed as per autoscale disabled value.
29ded18
to
1f7b045
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does one test this?
Shouldn't line 186 (in the constructor) also be adapted?
this.nativeZoom = parent != null ? parent.nativeZoom : DPIUtil.getNativeDeviceZoom();
|
||
void handleDPIChange(Event event, float scalingFactor) { | ||
this.nativeZoom = event.detail; | ||
this.nativeZoom = this.autoScaleDisabled ? 100 : event.detail;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.nativeZoom = this.autoScaleDisabled ? 100 : event.detail;; | |
this.nativeZoom = this.autoScaleDisabled ? 100 : event.detail; |
|
||
if (DATA_AUTOSCALE_DISABLED.equals(key)) { | ||
autoScaleDisabled = Boolean.parseBoolean(value.toString()); | ||
this.nativeZoom = 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not take into account that autoScaleDisabled
might be set to false
. In that case, I would expect nativeZoom
to be reset to shell zoom, i.e., nativeZoom = getData(DATA_SHELL_ZOOM)
. That's only available in Control
but this functionality should be moved to Control
anyway as it does not make sense for Widget
, shouldn't it?
Few Widgets do not adhere to AUTO_SCALE_DISABLED field when set to true in Widget#setData. The proposed changes are as follow:
Detailed Analysis
These are the widgets or widget utils that should be affected when auto scale is disabled.
When should auto scale disabling function?
Whenever widget#nativeZoom or widget#getNativeZoom is called from any of the widget, the native zoom must be 100%.